#include "config.h"
#include "fc3_din.h"
#include "fc3_w.h"
#include "fc3_b.h"

#include <stdio.h>

#define FC3_IN_SIZE     84
#define FC3_OUT_SIZE    10

// 第3层全连接
void fc_i84_o10(
    dtype d_in[FC3_IN_SIZE],
    dtype d_out[FC3_OUT_SIZE],
    dtype weights[FC3_OUT_SIZE][FC3_IN_SIZE],
    dtype bias[FC3_OUT_SIZE]
    ){
    
    for (int i = 0; i < FC3_OUT_SIZE; i++){
        dtype tmp = 0;
        for (int j = 0; j < FC3_IN_SIZE; j++){
            tmp += Q4_12_MULL(d_in[j], weights[i][j]);
        }
        d_out[i] = Q4_12_RELU(tmp + bias[i]);
        // d_out[i] = tmp + bias[i];
    }
}

dtype d_out[FC3_OUT_SIZE];

int main(int argc, char const *argv[])
{
    fc_i84_o10((dtype *)fc3_din, (dtype *)d_out, (dtype (*)[84])fc3_w, (dtype *)fc3_b);
    for (int i = 0; i < 10; i++){
        printf("%d\n", d_out[i]);
    }
    return 0;
}
